package com.jishuo.nontax.bean.vo;

import com.jishuo.base.util.StringObject;
import com.jishuo.nontax.bean.bank.PayFisc;
import com.jishuo.nontax.bean.message.SetBankPayFisc;
import com.jishuo.nontax.bean.message.SetBankPayFiscBackOut;
import com.jishuo.nontax.bean.message.SetPayFisc;
import com.jishuo.nontax.bean.message.SetPayFiscNew;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @auther dinggaofei
 * @Date 2023/2/6 9:51
 * @tableName T_FSPAYFISC 缴国库收入表
 */
@SuppressWarnings("serial")
@Data
public class PayFiscVO {
    //流水号
    private Long payid;
    //行政区划流水号
    private Long cantonid;
    //票据号 GK20090317001
    private String billnum;
    //项目流水号
    private Long itemid1;
    //收款国库
    private String payeefisc;
    //缴款单位银行流水号
    private Long payerbankid;
    //收款单位财政机关
    private String payeedepart;
    //项目1金额
    private BigDecimal itemmoney1;
    //项目流水号
    private Long itemid2;
    //是否银行确认划款
    private int isbankaffirm;
    //银行交易流水号
    private String bankaffirm;
    //银行划款时间
    private String paybankdt;
    //银行网点 名称
    private String bankstation;
    //单据状态
    private int billstate;
    //
    private Integer issend;
    //
    private Long messageid;
    //打印时间
    private String writedate;
    //发送时间
    private String sendtime;
    //银行核心交易流水号
    private String hxbankaffirm;
    //项目编码
    private String itemcode;
    //项目名称
    private String itemname;
    //区划编码
    private String cantoncode;
    //区划名称
    private String cantonname;
    //账户
    private String accountcode;
    //账户名称
    private String accountname;
    //银行名称
    private String bankname;

    private String billid;

    /**
     * 金额
     */
    private BigDecimal money;

    public PayFiscVO() {
    }

    ;

    // 返回PayFisc类
    public PayFisc getPayFisc() {
        PayFisc fisc = new PayFisc();
        fisc.setBillnum(this.billnum);
        fisc.setPayid(StringObject.objectString(this.payid));
        fisc.setCantonid(StringObject.objectString(this.cantonid));
        fisc.setCantoncode(this.cantoncode);
        fisc.setCantonname(this.cantonname);
        fisc.setItemid(StringObject.objectString(this.itemid1));
        fisc.setItemname(this.itemname);
        fisc.setItemcode(this.itemcode);
        fisc.setPayeedepart(this.payeedepart);
        fisc.setPayeefisc(this.payeefisc);
        fisc.setPayerbankid(StringObject.objectString(this.payerbankid));
        fisc.setAccountcode(this.accountcode);
        fisc.setAccountname(this.accountname);
        fisc.setBankname(this.bankname);
        fisc.setMoney(StringObject.objectString(this.itemmoney1));
        fisc.setBillstate(StringObject.objectString(this.billstate));
        return fisc;
    }

    //返回SetBankPayFisc类
    public SetBankPayFisc setFiscPayInfo() {
        SetBankPayFisc fisc = new SetBankPayFisc();
        fisc.setPayid(StringObject.objectString(this.payid));
        fisc.setBillnum(this.billnum);
        fisc.setCantonid(StringObject.objectString(this.cantonid));
        fisc.setPayerbankid(StringObject.objectString(this.payerbankid));
        fisc.setPayeedepart(this.payeedepart);
        fisc.setPayeefisc(this.payeefisc);
        fisc.setItemid(StringObject.objectString(this.itemid1));
        fisc.setMoney(StringObject.objectString(this.itemmoney1));
        fisc.setBankaffirm(this.bankaffirm);
        fisc.setPaybankdt(this.paybankdt);
        this.setBankstation(this.bankstation);
        return fisc;
    }

    //从SetPayFisc获取数据
    public PayFiscVO(SetPayFisc fisc) {
        this.billnum = fisc.getBillnum();
        this.cantonid = Long.parseLong(fisc.getCantonid());
        this.payerbankid = Long.parseLong(fisc.getPayerbankid());
        this.payeedepart = fisc.getPayeedepart();
        this.payeefisc = fisc.getPayeefisc();
        this.itemid1 = Long.parseLong(fisc.getItemid());
        this.itemmoney1 = new BigDecimal(fisc.getMoney());
    }

    //从SetPayFisc获取数据
    public PayFiscVO(SetPayFiscNew fisc) {
        this.billnum = fisc.getBillnum();
        this.cantonid = Long.parseLong(fisc.getCantonid());
        this.payerbankid = Long.parseLong(fisc.getPayerbankid());
        this.payeedepart = fisc.getPayeedepart();
        this.payeefisc = fisc.getPayeefisc();
        this.itemid1 = Long.parseLong(fisc.getItemid());
        this.itemmoney1 = new BigDecimal(fisc.getMoney());
        this.itemcode = fisc.getItemcode();
        this.itemname = fisc.getItemname();
    }


    public SetBankPayFiscBackOut getSetFiscBackOut() {
        SetBankPayFiscBackOut out = new SetBankPayFiscBackOut();
        out.setPayid(StringObject.objectString(this.payid));
        out.setBillnum(StringObject.objectString(this.billnum));
        out.setCantonid(StringObject.objectString(this.cantonid));
        out.setPayerbankid(StringObject.objectString(this.payerbankid));
        out.getPayeedepart(this.payeedepart);
        out.setPayeefisc(this.payeefisc);
        out.setItemid(StringObject.objectString(this.itemid1));
        out.setMoney(StringObject.objectString(this.itemmoney1));
        out.setBankaffirm(this.bankaffirm);
        out.setBankstation(this.bankstation);
        return  out;

    }
}
